package com.utn.ab.user.controller;

import com.utn.ab.common.controller.BaseController;
import com.utn.ab.common.entity.ResultInfo;
import com.utn.ab.user.entity.User;
import com.utn.ab.user.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * @创建人 liuchunlin
 * @创建时间 10:11
 * @描述
 */
@RestController
@RequestMapping("/user")
public class UserController extends BaseController {

    @Autowired
    private UserInfoService userInfoService;

    /**
     * 注册
     */
    @PostMapping("/join")
    public void signUp(@Valid @RequestBody User user, BindingResult errors){
        userInfoService.join(user);
    }

    /**
     * 密码登录
     */
    @PostMapping("/auth/form")
    public ResultInfo signInByForm(@RequestBody User user){
        return null;
    }

    /**
     * 手机登录
     */
    @GetMapping("/auth/mobile")
    public ResultInfo signInByMobile(@RequestParam String mobile){
        return null;
    }
}
